<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js_qurySelector</title>
    <style>
        #btn
        {
            background-color: darkgray;
            font: 2em '华文宋体';
            font-weight: bold;
            text-align: center;
            height: 100px;
            width: 200px;
        }
        #box{
            width: 200px;
            height: 200px;
            background-color: #0c5460;
            font-size: 10px;
        }
    </style>

</head>
<body>
<button id="btn">按钮</button>
<div id="box" style="width: 200px;">这是js实验</div>
<script>
    // document.querySelector("#btn").onclick=function () {
    //     console.log(document.querySelector("#btn"))
    //     document.querySelector("#btn").style.backgtound-color=red;
    // }
    document.getElementById('btn').onclick=function () {
        document.getElementById('btn').style.background='orange';
    };

</script>
</body>
</html>